// function* foo(x) {
//     let y = 2 * (yield (x + 1))
//     let z = yield (y / 3)
//     return (x + y + z)
// }

// let it = foo(5) // new Generator() // 迭代器
// console.log(it.next());

function ajax(url, callback) {

}

function* fetch() {
    yield ajax(URL, () => { }) // 1000
    yield ajax(URL1, () => { }) // 500
    yield ajax(URL2, () => { }) // 700
}
let it = fetch()
let res1 = it.next()
let res2 = it.next()
let res3 = it.next()